package com.test.controller;

import com.test.model.Student;
import com.test.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * @Author：徐志荣
 * @Date：2023/6/7 下午 7:43
 */

//同⼀类型多个 @Bean 报错
@Controller
public class StudentController5 {

/*
    @Resource(name = "stu2")
   private Student s;
    public void sayHi(){
        System.out.println(s.toString());
    }
*/

    @Autowired
    @Qualifier("stu1")
    private Student student;
    public void sayHi(){
        System.out.println(student.toString());
    }


}
